﻿package java_45;

import java.util.Scanner;

public class CustormName {
	Scanner input=new Scanner(System.in);
	String[] name=new String[5];
	public String[] mingzi(){
		for(int i=1;i<=5;i++){
			System.out.println("请输入"+(i)+"客户姓名");
			name[i]=input.next();
		}
		return name;
	}
	
	}
	public int chaname(){
		System.out.println("请输入要修改的姓名:");
		String oldname=input.next();
		
		if (oldname!=null&&oldname.equals(name)) {
			
			return i;
		}
		return -1;
	}
	public boolean modifyName(){
		System.out.println("请输入新的姓名:");
		String newName=input.next();
		int index = searchName(oldname);
		if(index!=-1){
			names[index] = newName;
			return true;
		}
		return false;
	}
}